/*
 * Ext JS Library 2.2
 * Copyright(c) 2006-2008, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */

//
// This is the main layout definition.
//
Ext.onReady(function(){
	
	Ext.QuickTips.init();
	
	// This is an inner body element within the Details panel created to provide a "slide in" effect
	// on the panel body without affecting the body's box itself.  This element is created on
	// initial use and cached in this var for subsequent access.
	var detailEl;
	
	// This is the main content center region that will contain each example layout panel.
	// It will be implemented as a CardLayout since it will contain multiple panels with
	// only one being visible at any given time.
	
	var file_tabs_panel = {
		xtype: 'tabpanel',
		region: 'center',
		margins: '5 5 5 0',
		activeTab:0,
		id: 'file_tabs_panel',
		enableTabScroll : true,
		resizeTabs      : true,
		minTabWidth     : 50,
		maxTabWidth     : 150,
		//plain: true,  //remove the header border
		//activeItem:0,
		defaults: {bodyStyle: 'padding:5px'},
		items:[{
			title: '目录浏览',
			closable : false,
			tabTip   : '目录浏览',
			contentEl:'FileListPage'
		},{
			title: '<b>[文件]</b>这个用于测试的文件，使用尽量长的名字',
			closable : true,
			tabTip   : '<b>[文件]</b>这个用于测试的文件，使用尽量长的名字',
			html: 'This is tab 2 content.'
		},{
			title: 'Tab 3',
			closable : true,
			tabTip   : 'tab3',
			html: 'This is tab 3 content.'
		}]
	};
	
  
	// This is the Details panel that contains the description for each example layout.
	var IntroPanel = {
		id: 'intro-panel',
        title: '帮助',
        collapsible: true,
        region: 'west',
        split:true,
        //bodyStyle: 'padding-bottom:15px;background:#eee;',
		autoScroll: true,
		margins: '5 0 5 5',
		width: 100,
        minSize: 100,
        maxSize: 200,
        contentEl: 'Intro_Message'
    };
	
    new Ext.Viewport({
		layout: 'border',
		title: 'Ext Layout Browser',
		items: [{
			xtype: 'box',
			region: 'north',
			applyTo: 'header',
			height: 30
		},
		IntroPanel,
		file_tabs_panel
		],
        renderTo: Ext.getBody()
    });
    
    
});
/*
function AddFileTab(tt,filepath){
	alert(2);
	var FileTabs=Ext.get('file-tabs-panel');
	var tab=FileTabs.add({
        title: 'aa',
        html: 'bb',
        closable:true
    });
	alert(tab);
	tab.show();
	
}*/
